﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using NHibernate;
using NHibernate.Criterion;
using CondominioG1.Dominio;

namespace CondominioG1.Persistencia.NHibernate
{
    public class AreaDAO : BaseDAO<Area, String>
    {
        public ICollection<Area> ListarAreaPorTipo(String tipo)
        {
            using (ISession sesion = NHibernateHelper.AbrirSesion())
            {
                ICollection<Area> resultado = sesion
                        .CreateCriteria(typeof(Area))
                        .Add(Restrictions.Eq("Tipo", tipo))
                        .List<Area>();
                return resultado;
            }
        }

    }
}
